package com.zf.yichat.mapper;

import com.zf.yichat.base.FsMapper;
import com.zf.yichat.model.UserBalance;
import com.zf.yichat.model.WxWalletCoin;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

public interface UserBalanceMapper extends FsMapper<UserBalance> {

    int updateBalance(@Param("userId") Long userId, @Param("money") BigDecimal money, @Param("freezeMoney") BigDecimal freezeMoney, @Param("incomeMoney") BigDecimal incomeMoney);

    BigDecimal sumTotal();

    /**
     * 根据用户ID查询余额信息
     * @param userId
     * @return
     */
    UserBalance queryBalanceByUserId(@Param("userId") Long userId);

    /**
     * 批量更新用户余额
     * @param data
     */
    void batchUpdateUserBalance (List<UserBalance> data);
}